package cn.edu.zjut.mina.protocal;

/** 
 * 消息协议-请求 
 *  
 * @author Simple 
 *  
 */  
public class JMessageProtocalReq extends JAbsMessageProtocal {  
  
  private short functionCode;// 功能代码  
  
  private String content;// 请求内容
  
  @Override  
  public int getLength() {  
    return 2 + (content == null ? 0 : content.getBytes().length);  
  }  
  
  @Override  
  public byte getTag() {  
    return JConstant.REQ;  
  }  
  
  public void setFunctionCode(short functionCode) {  
    this.functionCode=functionCode;  
  }  
  
  public short getFunctionCode() {  
    return functionCode;  
  }  
  
  public void setContent(String content) {  
    this.content=content;  
  }  
  
  public String getContent() {  
    return content;  
  }  
  
  @Override  
  public String toString() {  
    return "JMessageProtocalReq [content=" + content + ", functionCode=" + functionCode + ", getLength()=" + getLength()  
      + ", getTag()=" + getTag() + "]";  
  }  
}
